package cn.com.cifi.mars.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

import javax.servlet.http.HttpServletResponse;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import cn.com.cifi.mars.bean.dto.RemovalReportDataDto;
import cn.com.cifi.mars.constant.OrgTypeEunm;
import cn.com.cifi.mars.entity.SysProduct;
import lombok.extern.slf4j.Slf4j;

/**
 * sheet 索引从 0 开始
 * row 索引从 0 开始
 * column 索引从 0 开始
 */
@Slf4j
public class RemovalReportTemplate {

    private static final String TEMPLATE_PATH = "/template/removal_report.xlsx";

    private static final String HISTORY_PATTERN = "{history}";

    private static final String CURRENT_PATTERN = "{current}";

    /**
     * 楼栋以及面积段 模板行索引
     */
    private int baseRowIndex = 3;

    /**
     * 数据模板行 - 楼栋面积段
     */
    private Row baseRow;

    /**
     * 数据开始行
     */
    private int dataBeginRow = 3;

    /**
     * 当前行标
     */
    private int currentDataRowCursor = dataBeginRow;

    /**
     * 月份动态列模板开始索引
     */
    private int dynamicColumnBeginIndex = 97;

    /**
     * 月份动态列模板结束索引
     */
    private int dynamicColumnEndIndex = 116;
    
    private int endIndex = 116;

    /**
     * 基本信息结束列标
     */
    private int baseInfoEndColumn = 43;

    private String endDate;

    /**
     * 由于一开始模板没有需要根据不同级别区分不同样式的需求
     * 现在有了这种需求，直接改方法对原代码改动太大
     * 因此使用全局变量控制当前的组织机构类型
     */
    private OrgTypeEunm currentType;
    //单元格样式
    private CellStyle headCellStyle;
    //套数、均价、金额样式
    private CellStyle cellStyle1;
    //面积样式
    private CellStyle cellStyle2;
    //去化率样式
    private CellStyle cellStyle3;
    
    SXSSFWorkbook wb;
    Sheet sheet;

    public RemovalReportTemplate(List<RemovalReportDataDto> resultDataList,List<SysProduct> projectList,String date,String sheetName,String reportName,
    		HttpServletResponse response) {
        try {
            endDate = date;
            InputStream tempInputStream = RemovalReportTemplate.class.getResourceAsStream(TEMPLATE_PATH);
            if (tempInputStream != null) {
            	XSSFWorkbook wb1 = new XSSFWorkbook(tempInputStream);
            	wb = new SXSSFWorkbook(wb1, -1);
            	//第一行标题
                sheet = wb.getSheetAt(0);
                //样式模板行,数据首行定义了数据的格式
                baseRow = wb.getXSSFWorkbook().getSheetAt(0).getRow(baseRowIndex);
                headCellStyle = wb.getXSSFWorkbook().getSheetAt(0).getRow(2).getCell(45).getCellStyle();
                cellStyle1 = wb.getXSSFWorkbook().getSheetAt(0).getRow(3).getCell(45).getCellStyle();
                cellStyle2 = wb.getXSSFWorkbook().getSheetAt(0).getRow(3).getCell(47).getCellStyle();
                cellStyle3 = wb.getXSSFWorkbook().getSheetAt(0).getRow(3).getCell(94).getCellStyle();
                setHistoryDate();
                setCurrentDate();
                insertDynamicColumn();
                for(RemovalReportDataDto obj : resultDataList) {
                	appendRow(obj,projectList);
    			}
                setSheetDate();
            }
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            throw new RuntimeException(e);
        }
    }
    
    public void insertDynamicColumn() {
    	 String[] split = endDate.split("-");
         String year = split[0];
         Integer month = Integer.valueOf(split[1]) + 2;
         int dynamicLen = dynamicColumnEndIndex - dynamicColumnBeginIndex;
        for (int i = 0; i < this.dataBeginRow; i++) {
        	Row row = wb.getXSSFWorkbook().getSheetAt(0).getRow(i);
            for (int k = 1; k <= month; k++) {
            	int beginIndex = dynamicColumnBeginIndex;
            	if(k == month -1) {
            		beginIndex = endIndex ;
            		endIndex = beginIndex + 30;
            	}else if(k == month) {
            		beginIndex = endIndex ;
            		endIndex = beginIndex + dynamicLen;
            	}else {
            		beginIndex = dynamicColumnBeginIndex + (dynamicLen * (k-1));
            		endIndex = beginIndex + dynamicLen;
            	}
                for (int j = beginIndex; j < endIndex; j++) {
                    Cell to = row.createCell(j);
                    to.setCellStyle(headCellStyle);
                    if(i == 0) {
                    	 if(k == month -1) {
                    		 to.setCellValue(year + "年年度（合计）"); 
                    	 }else if (k == month) {
                    		 to.setCellValue("整盘"); 
                    	 }else {
                    		 to.setCellValue(year + "年" + k + "月");
                    	 }
                	}else {
                		String columnValue = "";
                		if(i == 1) {
                			if(k == month -1) {
                				if(j >= beginIndex && j<= beginIndex+7) {
                    				columnValue = "年度实际可售";
                    			}else if(j >= beginIndex+8 && j<= beginIndex+8+7) {
                    				columnValue = "年度实际可售\r\n" + 
                    						"（不含未推售阶段自持存货）";
                    			}else if(j >= beginIndex+8+8 && j<= beginIndex+8+8+7) {
                    				columnValue = "年度实际签约";
                    			}else if(j >= beginIndex+8+8+8 && j<= beginIndex+8+8+7+3) {
                    				columnValue = "年度去化率";
                    			}else {
                    				columnValue = "年度去化率\r\n" + 
                    						"（不含未推售阶段自持存货）";
                    			}
                			}else if(k == month){
                				if(j >= beginIndex && j<= beginIndex+7) {
                    				columnValue = "累计实际供货";
                    			}else if(j >= beginIndex+8 && j<= beginIndex+8+7) {
                    				columnValue = "累计实际签约";
                    			}else {
                    				columnValue = "去化率";
                    			}
                			}else {
                				if(j >= beginIndex && j<= beginIndex+7) {
                    				columnValue = "本月实际可售";
                    			}else if(j >= beginIndex+8 && j<= beginIndex+8+7) {
                    				columnValue = "本月实际签约";
                    			}else {
                    				columnValue = "去化率";
                    			}
                			}
                		}else if(i == 2) {
                			if(k == month -1) {
                				if( j == beginIndex || j == beginIndex + 8 || j == beginIndex + 8 + 8) {
                    				columnValue = "套数\r\n" + 
                    						"(套)";
                    			}else if( j == beginIndex+1 || j == beginIndex+9 || j == beginIndex+9 + 8) {
                    				columnValue = "车位数\r\n" + 
                    						"(个)";
                    			}else if( j == beginIndex+2 || j == beginIndex+10 || j == beginIndex+10 + 8) {
                    				columnValue = "面积\r\n" + 
                    						"（平米）";
                    			}else if( j == beginIndex+3 || j == beginIndex+11  || j == beginIndex + 11 + 8) {
                    				columnValue = "均价\r\n" + 
                    						"（元/平米）";
                    			}else if( j == beginIndex+4 || j == beginIndex+12 || j == beginIndex+12 + 8) {
                    				columnValue = "车位均价\r\n" + 
                    						"（元/个）";
                    			}else if( j == beginIndex+5 || j == beginIndex+13 || j == beginIndex+13 + 8) {
                    				columnValue = "合计金额\r\n" + 
                    						"（万元）";
                    			}else if( j == beginIndex+6 || j == beginIndex+14 || j == beginIndex+14 + 8) {
                    				columnValue = "房源金额\r\n" + 
                    						"（万元）";
                    			}else if( j == beginIndex+7 || j == beginIndex+15 || j == beginIndex + 15 + 8) {
                    				columnValue = "车位金额\r\n" + 
                    						"（万元）";
                    			}else if( j == beginIndex+24 || j == beginIndex+27) {
                    				columnValue = "套数\r\n" + 
                    						"（%）";
                    			}else if( j == beginIndex+25 || j == beginIndex + 28) {
                    				columnValue = "面积\r\n" + 
                    						"（%）";
                    			}else if( j == beginIndex+26 || j == beginIndex + 29) {
                    				columnValue = "金额\r\n" + 
                    						"（%）";
                    			}
                			}else {
                				if( j == beginIndex || j == beginIndex + 8) {
                    				columnValue = "套数\r\n" + 
                    						"(套)";
                    			}else if( j == beginIndex+1 || j == beginIndex+9) {
                    				columnValue = "车位数\r\n" + 
                    						"(个)";
                    			}else if( j == beginIndex+2 || j == beginIndex+10) {
                    				columnValue = "面积\r\n" + 
                    						"（平米）";
                    			}else if( j == beginIndex+3 || j == beginIndex+11) {
                    				columnValue = "均价\r\n" + 
                    						"（元/平米）";
                    			}else if( j == beginIndex+4 || j == beginIndex+12) {
                    				columnValue = "车位均价\r\n" + 
                    						"（元/个）";
                    			}else if( j == beginIndex+5 || j == beginIndex+13) {
                    				columnValue = "合计金额\r\n" + 
                    						"（万元）";
                    			}else if( j == beginIndex+6 || j == beginIndex+14) {
                    				columnValue = "房源金额\r\n" + 
                    						"（万元）";
                    			}else if( j == beginIndex+7 || j == beginIndex+15) {
                    				columnValue = "车位金额\r\n" + 
                    						"（万元）";
                    			}else if( j == beginIndex+16) {
                    				columnValue = "套数\r\n" + 
                    						"（%）";
                    			}else if( j == beginIndex+17) {
                    				columnValue = "面积\r\n" + 
                    						"（%）";
                    			}else if( j == beginIndex+18) {
                    				columnValue = "金额\r\n" + 
                    						"（%）";
                    			}
                			}
                		}
                		to.setCellValue(columnValue);
                	}
                    
                    if(k == month -1) {
                    	 if (i == 0 && j == endIndex - 1) {
                             sheet.addMergedRegion(new CellRangeAddress(i, i, j + 1 - 30, j ));
                         } else if (i == 1 && j == endIndex - 1 ) {
                             sheet.addMergedRegion(new CellRangeAddress(i, i, j + 1 - 30, j - 30 + 8));
                             sheet.addMergedRegion(new CellRangeAddress(i, i, j + 1 - 30 + 8, j - 30 + 8 + 8));
                             sheet.addMergedRegion(new CellRangeAddress(i, i, j + 1 - 30 + 8 + 8, j - 30 + 8 + 8 + 8));
                             sheet.addMergedRegion(new CellRangeAddress(i, i, j + 1 - 30 + 8 + 8 + 8, j - 30 + 8 + 8 + 8 + 3));
                             sheet.addMergedRegion(new CellRangeAddress(i, i, j + 1 - 30 + 8 + 8 + 8 + 3, j - 30 + 8 + 8 + 8 + 3 + 3));
                         }
                    }else {
                    	 if (i == 0 && j == beginIndex + dynamicLen - 1) {
                             sheet.addMergedRegion(new CellRangeAddress(i, i, j + 1 - dynamicLen, j ));
                         } else if (i == 1 && j == beginIndex + dynamicLen - 1 ) {
                             sheet.addMergedRegion(new CellRangeAddress(i, i, j + 1 - dynamicLen, j - dynamicLen + 8));
                             sheet.addMergedRegion(new CellRangeAddress(i, i, j + 1 - dynamicLen + 8, j - dynamicLen + 8 + 8));
                             sheet.addMergedRegion(new CellRangeAddress(i, i, j + 1 - dynamicLen + 8 + 8, j - dynamicLen + 8 + 8 + 3));
                         }
                    }
                }
            }
        }
    }

    public void setSheetDate() {
    	wb.setSheetName(0, wb.getSheetName(0).replace("yyyyMM", endDate));
    }
    
	public void setHistoryDate() {
    	Row row = wb.getXSSFWorkbook().getSheetAt(0).getRow(0);
        if (row != null) {
            for (int i = 0; i < row.getPhysicalNumberOfCells(); i++) {
            	Cell cell = row.getCell(i);
                if (cell != null && cell.getStringCellValue().contains(HISTORY_PATTERN)) {
                    cell.setCellValue(cell.getStringCellValue().replace(HISTORY_PATTERN, String.valueOf(Integer.valueOf(endDate.split("-")[0])-1)));
                }
            }
        }
    }

    public void setCurrentDate() {
    	Row row = wb.getXSSFWorkbook().getSheetAt(0).getRow(0);
        if (row != null) {
            for (int i = 0; i < row.getPhysicalNumberOfCells(); i++) {
            	Cell cell = row.getCell(i);
                if (cell != null && cell.getStringCellValue().contains(CURRENT_PATTERN)) {
                    cell.setCellValue(cell.getStringCellValue().replace(CURRENT_PATTERN, endDate.split("-")[0]));
                }
            }
        }
    }

    public void copyRowStyle(Row from, Row to) {
        to.setHeight(from.getHeight());
        if (from != null && to != null && from != to && from.getRowStyle() != null) {
            to.setRowStyle(from.getRowStyle());
        }
    }

    public void copyCellStyle(Cell from,Cell to) {
        if (from != null && to != null && from != to && from.getCellStyle() != null) {
            to.setCellStyle(from.getCellStyle());
            if (from.getRow() == sheet.getRow(0)){
                int columnWidth = sheet.getColumnWidth(from.getColumnIndex());
                sheet.setColumnWidth(to.getColumnIndex(),columnWidth);
            }
        }
    }

    public void copyCellStyle(Cell to,OrgTypeEunm orgTypeEunm) {
    	Cell baseRow1Cell = baseRow.getCell(to.getColumnIndex());
        copyCellStyle(baseRow1Cell,to);
    }

    public void appendSpaceColumn(Row row,AtomicInteger index){
        while (index.get() < baseInfoEndColumn){
            this.appendCell(row, index.addAndGet(1), "");
        }
    }
    
    private String getProductParent(List<SysProduct> projectList,String code) {
    	if(StrUtils.isEmpty(code)) {
    		return "";
    	}
    	for(SysProduct obj : projectList) {
    		if(code.equals(obj.getCode())) {
    			String parentCode = obj.getParentCode();
    			if(StrUtils.isEmpty(parentCode) ) {
    				return obj.getName();
    			}
    			return getProductParent(projectList,obj.getParentCode());
    		}
    	}
    	return "";
    }

    /**
     * 插入行
     *
     * @param map
     */
    public synchronized void appendRow(RemovalReportDataDto obj,List<SysProduct> projectList) {
    	Row row = wb.getXSSFWorkbook().getSheetAt(0).getRow(currentDataRowCursor);
        if (row == null) {
            row = sheet.createRow(currentDataRowCursor);
        }
        AtomicInteger index = new AtomicInteger(-1);
        this.appendCell(row, index.addAndGet(1),obj.getLevelType());
        this.appendCell(row, index.addAndGet(1), "0".equals(obj.getIlevel()) ? obj.getLevelName() : obj.getRegionName());
        this.appendCell(row, index.addAndGet(1), obj.getCityName());
        this.appendCell(row, index.addAndGet(1), obj.getProjectName());
        this.appendCell(row, index.addAndGet(1), obj.getProjectCode());
        this.appendCell(row, index.addAndGet(1), obj.getIsFirstOpen());
        this.appendCell(row, index.addAndGet(1), obj.getProjectfName());
        this.appendCell(row, index.addAndGet(1), obj.getProjectfCode());
        this.appendCell(row, index.addAndGet(1), obj.getProjectfEquityRatio());
        this.appendCell(row, index.addAndGet(1), obj.getOpMarketing());
        this.appendCell(row, index.addAndGet(1), obj.getIsAndTable());
        this.appendCell(row, index.addAndGet(1), obj.getIsExistRoomSale());
        this.appendCell(row, index.addAndGet(1), obj.getGroupName());
        //新增业态大类
        this.appendCell(row, index.addAndGet(1),getProductParent(projectList,obj.getProductTypeCode()) );
        this.appendCell(row, index.addAndGet(1), obj.getProductTypeName());
        this.appendCell(row, index.addAndGet(1), obj.getProductTypeCode());
        this.appendCell(row, index.addAndGet(1), obj.getProductName());
        this.appendCell(row, index.addAndGet(1), obj.getProductCode());
        this.appendCell(row, index.addAndGet(1), obj.getPhyBuildingName());
        this.appendCell(row, index.addAndGet(1), obj.getBuildingName());
        this.appendCell(row, index.addAndGet(1), obj.getIsProductExistRoomSale());
        this.appendCell(row, index.addAndGet(1), obj.getBusinessTypeName());
        this.appendCell(row, index.addAndGet(1), obj.getFreeTypeName());
        this.appendCell(row, index.addAndGet(1), obj.getProTypeName());
        
        this.appendCell(row, index.addAndGet(1), obj.getOpenTime());
        this.appendCell(row, index.addAndGet(1), obj.getOpenTimeActual());
        this.appendCell(row, index.addAndGet(1), obj.getAdvanceSaleTime());
        this.appendCell(row, index.addAndGet(1), obj.getAdvanceSaleTimeActual());
        this.appendCell(row, index.addAndGet(1), obj.getSupplyTime());
        this.appendCell(row, index.addAndGet(1), obj.getSupplyTimeVirtual());
        this.appendCell(row, index.addAndGet(1), obj.getSupplyTimeActual());
        this.appendCell(row, index.addAndGet(1), obj.getOpenSaleTime());
        this.appendCell(row, index.addAndGet(1), obj.getOpenSaleTimeActual());
        this.appendCell(row, index.addAndGet(1), obj.getCappingTime());
        this.appendCell(row, index.addAndGet(1), obj.getCappingTimeActual());
        this.appendCell(row, index.addAndGet(1), obj.getCompletedTime());
        this.appendCell(row, index.addAndGet(1), obj.getCompletedTimeActual());
        this.appendCell(row, index.addAndGet(1), obj.getCarryOverTime());
        this.appendCell(row, index.addAndGet(1), obj.getCarryOverTimeActual());
        this.appendCell(row, index.addAndGet(1), obj.getActualDeliveryTime());
        this.appendCell(row, index.addAndGet(1), obj.getActualDeliveryTimeActual());
        this.appendCell(row, index.addAndGet(1), obj.getContractDeliveryTime());
        this.appendCell(row, index.addAndGet(1), obj.getContractDeliveryTimeActual());
        this.appendCell(row, index.addAndGet(1), obj.getIsGetPreSaleCard() != null ? ReportUtils.toString(obj.getIsGetPreSaleCard() == 1?"是":"否") : "");
        //套均面积
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(obj.getRoomAvgArea()));
        
        //全盘-已售货值
        BigDecimal soldRoomNum = obj.getSoldRoomNum();
        BigDecimal soldStallNum = obj.getSoldStallNum();
        BigDecimal soldArea = obj.getSoldArea();
        BigDecimal soldStallPrice = obj.getSoldStallPrice();
        BigDecimal soldRoomPrice = obj.getSoldRoomPrice();
        BigDecimal roomAvgPrice = obj.getRoomAvgPrice();
        BigDecimal carAvgPrice = obj.getCarAvgPrice();
        BigDecimal totalPrice = obj.getTotalPrice();
        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(soldRoomNum));
   	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(soldStallNum));
   	 	this.appendCell(row, index.addAndGet(1), soldArea == null ? "" :ReportUtils.toString(soldArea.setScale(2,RoundingMode.HALF_UP)));
   	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(roomAvgPrice));
   	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(carAvgPrice));
   	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalPrice));
   	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(soldRoomPrice));
   	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(soldStallPrice));

        //全盘-存货货值
   	 	BigDecimal unSaleRoomNum = obj.getUnSaleRoomNum();
   	 	BigDecimal unSaleStallNum = obj.getUnSaleStallNum();
   	 	BigDecimal unSaleArea = obj.getUnSaleArea();
   	 	BigDecimal unSaleStallPrice = obj.getUnSaleStallPrice();
   	 	BigDecimal unSaleRoomPrice = obj.getUnSaleRoomPrice();
   	 	BigDecimal unSaleRoomAvgPrice = obj.getUnSaleRoomAvgPrice();
   	 	BigDecimal unSaleCarAvgPrice = obj.getUnSaleCarAvgPrice();
   	 	BigDecimal unSaleTotalPrice = obj.getUnSaleTotalPrice();
   	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(unSaleRoomNum));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(unSaleStallNum));
	 	this.appendCell(row, index.addAndGet(1), unSaleArea == null ? "" :ReportUtils.toString(unSaleArea.setScale(2,RoundingMode.HALF_UP)));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(unSaleRoomAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(unSaleCarAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(unSaleTotalPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(unSaleRoomPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(unSaleStallPrice));

	 	//全盘-规划货值
   	 	BigDecimal planRoomNum = obj.getPlanRoomNum();
   	 	BigDecimal planStallNum = obj.getPlanStallNum();
   	 	BigDecimal planArea = obj.getPlanArea();
   	 	BigDecimal planStallPrice = obj.getPlanStallPrice();
   	 	BigDecimal planRoomPrice = obj.getPlanRoomPrice();
   	 	BigDecimal planRoomAvgPrice = obj.getPlanRoomAvgPrice();
   	 	BigDecimal planCarAvgPrice = obj.getPlanCarAvgPrice();
   	 	BigDecimal planTotalPrice = obj.getPlanTotalPrice();
   	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(planRoomNum));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(planStallNum));
	 	this.appendCell(row, index.addAndGet(1),planArea == null ? "" : ReportUtils.toString(planArea.setScale(2,RoundingMode.HALF_UP)));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(planRoomAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(planCarAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(planTotalPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(planRoomPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(planStallPrice));

        //全盘-总货值合计
	 	BigDecimal totalRoomNum = obj.getTotalRoomNum();
   	 	BigDecimal totalStallNum = obj.getTotalStallNum();
   	 	BigDecimal totalArea = obj.getTotalArea();
   	 	BigDecimal totalStallPrice = obj.getTotalStallPrice();
   	 	BigDecimal totalRoomPrice = obj.getTotalRoomPrice();
   	 	BigDecimal totalRoomAvgPrice =  obj.getTotalRoomAvgPrice();
   	 	BigDecimal totalCarAvgPrice =  obj.getTotalCarAvgPrice();
   	 	BigDecimal totalTotalPrice =  obj.getTotalTotalPrice();
   	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalRoomNum));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalStallNum));
	 	this.appendCell(row, index.addAndGet(1),totalArea == null ? "" : ReportUtils.toString(totalArea.setScale(2,RoundingMode.HALF_UP)));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalRoomAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalCarAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalTotalPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalRoomPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalStallPrice));

        //全盘-权益货值
        BigDecimal rightPrice = MathUtils.isNoneZero( obj.getEquityPrice()) ? obj.getEquityPrice().divide(MathUtils.NUM_10000,0,RoundingMode.HALF_UP) : null;
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(rightPrice));

        //历史-供货
        BigDecimal historySupplyActualRoomCount = obj.getHistorySupplyActualRoomCount();
   	 	BigDecimal historySupplyActualStallCount = obj.getHistorySupplyActualStallCount();
   	 	BigDecimal historySupplyActualArea = obj.getHistorySupplyActualArea();
   	 	BigDecimal historySupplyActualStallPrice = obj.getHistorySupplyActualStallPrice();
   	 	BigDecimal historySupplyActualRoomPrice = obj.getHistorySupplyActualRoomPrice();
   	 	BigDecimal historySupplyActualRoomAvgPrice =  obj.getHistorySupplyActualRoomAvgPrice();
   	 	BigDecimal historySupplyActualCarAvgPrice =  obj.getHistorySupplyActualCarAvgPrice();
   	 	BigDecimal historySupplyActualTotalPrice =  obj.getHistorySupplyActualTotalPrice();
   	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(historySupplyActualRoomCount));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(historySupplyActualStallCount));
	 	this.appendCell(row, index.addAndGet(1), historySupplyActualArea == null ? "" :ReportUtils.toString(historySupplyActualArea.setScale(2,RoundingMode.HALF_UP)));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(historySupplyActualRoomAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(historySupplyActualCarAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(historySupplyActualTotalPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(historySupplyActualRoomPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(historySupplyActualStallPrice));
        //历史-签约
	 	BigDecimal historyContractRoomNum = obj.getHistoryContractRoomNum();
   	 	BigDecimal historyContractStallNum = obj.getHistoryContractStallNum();
   	 	BigDecimal historyContractRoomArea = obj.getHistoryContractRoomArea();
   	 	BigDecimal historyContractStallPrice = obj.getHistoryContractStallPrice();
   	 	BigDecimal historyContractRoomPrice = obj.getHistoryContractRoomPrice();
   	 	BigDecimal historyContractRoomAvgPrice = obj.getHistoryContractRoomAvgPrice();
   	 	BigDecimal historyContractCarAvgPrice = obj.getHistoryContractCarAvgPrice();
   	 	BigDecimal historyContractTotalPrice = obj.getHistoryContractTotalPrice();
   	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(historyContractRoomNum));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(historyContractStallNum));
	 	this.appendCell(row, index.addAndGet(1), historyContractRoomArea == null ? "" :ReportUtils.toString(historyContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(historyContractRoomAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(historyContractCarAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(historyContractTotalPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(historyContractRoomPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(historyContractStallPrice));
        //历史-去化
	 	BigDecimal historyCountRemovalRate = obj.getHistoryCountRemovalRate();
        BigDecimal historyAreaRemovalRate = obj.getHistoryAreaRemovalRate();
        BigDecimal historyPriceRemovalRate = obj.getHistoryPriceRemovalRate();
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(historyCountRemovalRate));
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(historyAreaRemovalRate));
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(historyPriceRemovalRate));
        
        
      //月度-去化
	 	/*套数去化率：产品楼栋的去年及以前（累计实际签约套数 / 累计实际供货套数）* 100%；
	 	面积去化率：产品楼栋的去年及以前（累计实际签约面积 / 累计实际供货面积）* 100%；
	 	金额去化率：产品楼栋的去年及以前（累计实际签约金额 / 累计实际供货金额）* 100%；*/
        String[] split = endDate.split("-");
        int month = Integer.valueOf(split[1]).intValue();
        //1月-供货
        BigDecimal month01stockRoomCount = obj.getMonth01stockRoomCount();
   	 	BigDecimal month01stockStallCount = obj.getMonth01stockStallCount();
   	 	BigDecimal month01stockRoomArea = obj.getMonth01stockRoomArea();
   	 	BigDecimal month01stockStallPrice = obj.getMonth01stockStallPrice();
   	 	BigDecimal month01stockRoomPrice = obj.getMonth01stockRoomPrice();
   	 	BigDecimal month01stockRoomAvgPrice = obj.getMonth01stockRoomAvgPrice();
   	 	BigDecimal month01stockCarAvgPrice = obj.getMonth01stockCarAvgPrice();
   	 	BigDecimal month01stockTotalPrice = obj.getMonth01stockTotalPrice();
   	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month01stockRoomCount));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month01stockStallCount));
	 	this.appendCell(row, index.addAndGet(1), month01stockRoomArea == null ? "" : ReportUtils.toString(month01stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month01stockRoomAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month01stockCarAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month01stockTotalPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month01stockRoomPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month01stockStallPrice));
        //1月-签约
	 	BigDecimal month01ContractRoomCount = obj.getMonth01ContractRoomNum();
	 	BigDecimal month01ContractStallCount = obj.getMonth01ContractStallNum();
	 	BigDecimal month01ContractRoomArea = obj.getMonth01ContractRoomArea();
	 	BigDecimal month01ContractStallPrice = obj.getMonth01ContractStallPrice();
	 	BigDecimal month01ContractRoomPrice = obj.getMonth01ContractRoomPrice();
	 	BigDecimal month01ContractRoomAvgPrice = obj.getMonth01ContractRoomAvgPrice();
	 	BigDecimal month01ContractCarAvgPrice = obj.getMonth01ContractCarAvgPrice();
	 	BigDecimal month01ContractTotalPrice = obj.getMonth01ContractTotalPrice();
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month01ContractRoomCount));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month01ContractStallCount));
 	 	this.appendCell(row, index.addAndGet(1),month01ContractRoomArea == null ? "" : ReportUtils.toString(month01ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month01ContractRoomAvgPrice));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month01ContractCarAvgPrice));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month01ContractTotalPrice));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month01ContractRoomPrice));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month01ContractStallPrice));
        //1月-去化
	 	BigDecimal month01CountRemovalRate =obj.getMonth01CountRemovalRate();
        BigDecimal month01AreaRemovalRate = obj.getMonth01AreaRemovalRate();
        BigDecimal month01PriceRemovalRate = obj.getMonth01PriceRemovalRate();
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month01CountRemovalRate));
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month01AreaRemovalRate));
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month01PriceRemovalRate));
        if(month >= 2) {
	        //2月-供货
	        BigDecimal month02stockRoomCount = obj.getMonth02stockRoomCount();
	        BigDecimal month02stockStallCount = obj.getMonth02stockStallCount();
	        BigDecimal month02stockRoomArea = obj.getMonth02stockRoomArea();
	        BigDecimal month02stockStallPrice = obj.getMonth02stockStallPrice();
	        BigDecimal month02stockRoomPrice = obj.getMonth02stockRoomPrice();
	        BigDecimal month02stockRoomAvgPrice = obj.getMonth02stockRoomAvgPrice();
	        BigDecimal month02stockCarAvgPrice = obj.getMonth02stockCarAvgPrice();
	        BigDecimal month02stockTotalPrice = obj.getMonth02stockTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month02stockRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month02stockStallCount));
	        this.appendCell(row, index.addAndGet(1), month02stockRoomArea == null ? "" : ReportUtils.toString(month02stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month02stockRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month02stockCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month02stockTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month02stockRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month02stockStallPrice));
	        //2月-签约
	        BigDecimal month02ContractRoomCount = obj.getMonth02ContractRoomNum();
	        BigDecimal month02ContractStallCount = obj.getMonth02ContractStallNum();
	        BigDecimal month02ContractRoomArea = obj.getMonth02ContractRoomArea();
	        BigDecimal month02ContractStallPrice = obj.getMonth02ContractStallPrice();
	        BigDecimal month02ContractRoomPrice = obj.getMonth02ContractRoomPrice();
	        BigDecimal month02ContractRoomAvgPrice = obj.getMonth02ContractRoomAvgPrice();
	        BigDecimal month02ContractCarAvgPrice = obj.getMonth02ContractCarAvgPrice();
	        BigDecimal month02ContractTotalPrice = obj.getMonth02ContractTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month02ContractRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month02ContractStallCount));
	        this.appendCell(row, index.addAndGet(1),month02ContractRoomArea == null ? "" : ReportUtils.toString(month02ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month02ContractRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month02ContractCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month02ContractTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month02ContractRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month02ContractStallPrice));
	        //2月-去化
	        BigDecimal month02CountRemovalRate =obj.getMonth02CountRemovalRate();
	        BigDecimal month02AreaRemovalRate = obj.getMonth02AreaRemovalRate();
	        BigDecimal month02PriceRemovalRate = obj.getMonth02PriceRemovalRate();
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month02CountRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month02AreaRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month02PriceRemovalRate));
        }
        if(month >=3) {
	        //3月-供货
	        BigDecimal month03stockRoomCount = obj.getMonth03stockRoomCount();
	        BigDecimal month03stockStallCount = obj.getMonth03stockStallCount();
	        BigDecimal month03stockRoomArea = obj.getMonth03stockRoomArea();
	        BigDecimal month03stockStallPrice = obj.getMonth03stockStallPrice();
	        BigDecimal month03stockRoomPrice = obj.getMonth03stockRoomPrice();
	        BigDecimal month03stockRoomAvgPrice = obj.getMonth03stockRoomAvgPrice();
	        BigDecimal month03stockCarAvgPrice = obj.getMonth03stockCarAvgPrice();
	        BigDecimal month03stockTotalPrice = obj.getMonth03stockTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month03stockRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month03stockStallCount));
	        this.appendCell(row, index.addAndGet(1), month03stockRoomArea == null ? "" : ReportUtils.toString(month03stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month03stockRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month03stockCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month03stockTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month03stockRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month03stockStallPrice));
	        //3月-签约
	        BigDecimal month03ContractRoomCount = obj.getMonth03ContractRoomNum();
	        BigDecimal month03ContractStallCount = obj.getMonth03ContractStallNum();
	        BigDecimal month03ContractRoomArea = obj.getMonth03ContractRoomArea();
	        BigDecimal month03ContractStallPrice = obj.getMonth03ContractStallPrice();
	        BigDecimal month03ContractRoomPrice = obj.getMonth03ContractRoomPrice();
	        BigDecimal month03ContractRoomAvgPrice = obj.getMonth03ContractRoomAvgPrice();
	        BigDecimal month03ContractCarAvgPrice = obj.getMonth03ContractCarAvgPrice();
	        BigDecimal month03ContractTotalPrice = obj.getMonth03ContractTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month03ContractRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month03ContractStallCount));
	        this.appendCell(row, index.addAndGet(1),month03ContractRoomArea == null ? "" : ReportUtils.toString(month03ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month03ContractRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month03ContractCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month03ContractTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month03ContractRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month03ContractStallPrice));
	        //3月-去化
	        BigDecimal month03CountRemovalRate =obj.getMonth03CountRemovalRate();
	        BigDecimal month03AreaRemovalRate = obj.getMonth03AreaRemovalRate();
	        BigDecimal month03PriceRemovalRate = obj.getMonth03PriceRemovalRate();
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month03CountRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month03AreaRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month03PriceRemovalRate));
        }
        if(month >=4) {
	        //4月-供货
	        BigDecimal month04stockRoomCount = obj.getMonth04stockRoomCount();
	        BigDecimal month04stockStallCount = obj.getMonth04stockStallCount();
	        BigDecimal month04stockRoomArea = obj.getMonth04stockRoomArea();
	        BigDecimal month04stockStallPrice = obj.getMonth04stockStallPrice();
	        BigDecimal month04stockRoomPrice = obj.getMonth04stockRoomPrice();
	        BigDecimal month04stockRoomAvgPrice = obj.getMonth04stockRoomAvgPrice();
	        BigDecimal month04stockCarAvgPrice = obj.getMonth04stockCarAvgPrice();
	        BigDecimal month04stockTotalPrice = obj.getMonth04stockTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month04stockRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month04stockStallCount));
	        this.appendCell(row, index.addAndGet(1), month04stockRoomArea == null ? "" : ReportUtils.toString(month04stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month04stockRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month04stockCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month04stockTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month04stockRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month04stockStallPrice));
	        //4月-签约
	        BigDecimal month04ContractRoomCount = obj.getMonth04ContractRoomNum();
	        BigDecimal month04ContractStallCount = obj.getMonth04ContractStallNum();
	        BigDecimal month04ContractRoomArea = obj.getMonth04ContractRoomArea();
	        BigDecimal month04ContractStallPrice = obj.getMonth04ContractStallPrice();
	        BigDecimal month04ContractRoomPrice = obj.getMonth04ContractRoomPrice();
	        BigDecimal month04ContractRoomAvgPrice = obj.getMonth04ContractRoomAvgPrice();
	        BigDecimal month04ContractCarAvgPrice = obj.getMonth04ContractCarAvgPrice();
	        BigDecimal month04ContractTotalPrice = obj.getMonth04ContractTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month04ContractRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month04ContractStallCount));
	        this.appendCell(row, index.addAndGet(1),month04ContractRoomArea == null ? "" : ReportUtils.toString(month04ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month04ContractRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month04ContractCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month04ContractTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month04ContractRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month04ContractStallPrice));
	        //4月-去化
	        BigDecimal month04CountRemovalRate =obj.getMonth04CountRemovalRate();
	        BigDecimal month04AreaRemovalRate = obj.getMonth04AreaRemovalRate();
	        BigDecimal month04PriceRemovalRate = obj.getMonth04PriceRemovalRate();
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month04CountRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month04AreaRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month04PriceRemovalRate));
        }
        if(month >= 5) {
	        //5月-供货
	        BigDecimal month05stockRoomCount = obj.getMonth05stockRoomCount();
	        BigDecimal month05stockStallCount = obj.getMonth05stockStallCount();
	        BigDecimal month05stockRoomArea = obj.getMonth05stockRoomArea();
	        BigDecimal month05stockStallPrice = obj.getMonth05stockStallPrice();
	        BigDecimal month05stockRoomPrice = obj.getMonth05stockRoomPrice();
	        BigDecimal month05stockRoomAvgPrice = obj.getMonth05stockRoomAvgPrice();
	        BigDecimal month05stockCarAvgPrice = obj.getMonth05stockCarAvgPrice();
	        BigDecimal month05stockTotalPrice = obj.getMonth05stockTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month05stockRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month05stockStallCount));
	        this.appendCell(row, index.addAndGet(1), month05stockRoomArea == null ? "" : ReportUtils.toString(month05stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month05stockRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month05stockCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month05stockTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month05stockRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month05stockStallPrice));
	        //5月-签约
	        BigDecimal month05ContractRoomCount = obj.getMonth05ContractRoomNum();
	        BigDecimal month05ContractStallCount = obj.getMonth05ContractStallNum();
	        BigDecimal month05ContractRoomArea = obj.getMonth05ContractRoomArea();
	        BigDecimal month05ContractStallPrice = obj.getMonth05ContractStallPrice();
	        BigDecimal month05ContractRoomPrice = obj.getMonth05ContractRoomPrice();
	        BigDecimal month05ContractRoomAvgPrice = obj.getMonth05ContractRoomAvgPrice();
	        BigDecimal month05ContractCarAvgPrice = obj.getMonth05ContractCarAvgPrice();
	        BigDecimal month05ContractTotalPrice = obj.getMonth05ContractTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month05ContractRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month05ContractStallCount));
	        this.appendCell(row, index.addAndGet(1),month05ContractRoomArea == null ? "" : ReportUtils.toString(month05ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month05ContractRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month05ContractCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month05ContractTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month05ContractRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month05ContractStallPrice));
	        //5月-去化
	        BigDecimal month05CountRemovalRate =obj.getMonth05CountRemovalRate();
	        BigDecimal month05AreaRemovalRate = obj.getMonth05AreaRemovalRate();
	        BigDecimal month05PriceRemovalRate = obj.getMonth05PriceRemovalRate();
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month05CountRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month05AreaRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month05PriceRemovalRate));
        }
        if(month >= 6) {
	      //6月-供货
	        BigDecimal month06stockRoomCount = obj.getMonth06stockRoomCount();
	        BigDecimal month06stockStallCount = obj.getMonth06stockStallCount();
	        BigDecimal month06stockRoomArea = obj.getMonth06stockRoomArea();
	        BigDecimal month06stockStallPrice = obj.getMonth06stockStallPrice();
	        BigDecimal month06stockRoomPrice = obj.getMonth06stockRoomPrice();
	        BigDecimal month06stockRoomAvgPrice = obj.getMonth06stockRoomAvgPrice();
	        BigDecimal month06stockCarAvgPrice = obj.getMonth06stockCarAvgPrice();
	        BigDecimal month06stockTotalPrice = obj.getMonth06stockTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month06stockRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month06stockStallCount));
	        this.appendCell(row, index.addAndGet(1), month06stockRoomArea == null ? "" : ReportUtils.toString(month06stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month06stockRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month06stockCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month06stockTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month06stockRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month06stockStallPrice));
	        //6月-签约
	        BigDecimal month06ContractRoomCount = obj.getMonth06ContractRoomNum();
	        BigDecimal month06ContractStallCount = obj.getMonth06ContractStallNum();
	        BigDecimal month06ContractRoomArea = obj.getMonth06ContractRoomArea();
	        BigDecimal month06ContractStallPrice = obj.getMonth06ContractStallPrice();
	        BigDecimal month06ContractRoomPrice = obj.getMonth06ContractRoomPrice();
	        BigDecimal month06ContractRoomAvgPrice = obj.getMonth06ContractRoomAvgPrice();
	        BigDecimal month06ContractCarAvgPrice = obj.getMonth06ContractCarAvgPrice();
	        BigDecimal month06ContractTotalPrice = obj.getMonth06ContractTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month06ContractRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month06ContractStallCount));
	        this.appendCell(row, index.addAndGet(1),month06ContractRoomArea == null ? "" : ReportUtils.toString(month06ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month06ContractRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month06ContractCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month06ContractTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month06ContractRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month06ContractStallPrice));
	        //6月-去化
	        BigDecimal month06CountRemovalRate =obj.getMonth06CountRemovalRate();
	        BigDecimal month06AreaRemovalRate = obj.getMonth06AreaRemovalRate();
	        BigDecimal month06PriceRemovalRate = obj.getMonth06PriceRemovalRate();
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month06CountRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month06AreaRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month06PriceRemovalRate));
        }
        if(month >=7) {
	      //7月-供货
	        BigDecimal month07stockRoomCount = obj.getMonth07stockRoomCount();
	        BigDecimal month07stockStallCount = obj.getMonth07stockStallCount();
	        BigDecimal month07stockRoomArea = obj.getMonth07stockRoomArea();
	        BigDecimal month07stockStallPrice = obj.getMonth07stockStallPrice();
	        BigDecimal month07stockRoomPrice = obj.getMonth07stockRoomPrice();
	        BigDecimal month07stockRoomAvgPrice = obj.getMonth07stockRoomAvgPrice();
	        BigDecimal month07stockCarAvgPrice = obj.getMonth07stockCarAvgPrice();
	        BigDecimal month07stockTotalPrice = obj.getMonth07stockTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month07stockRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month07stockStallCount));
	        this.appendCell(row, index.addAndGet(1), month07stockRoomArea == null ? "" : ReportUtils.toString(month07stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month07stockRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month07stockCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month07stockTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month07stockRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month07stockStallPrice));
	        //7月-签约
	        BigDecimal month07ContractRoomCount = obj.getMonth07ContractRoomNum();
	        BigDecimal month07ContractStallCount = obj.getMonth07ContractStallNum();
	        BigDecimal month07ContractRoomArea = obj.getMonth07ContractRoomArea();
	        BigDecimal month07ContractStallPrice = obj.getMonth07ContractStallPrice();
	        BigDecimal month07ContractRoomPrice = obj.getMonth07ContractRoomPrice();
	        BigDecimal month07ContractRoomAvgPrice = obj.getMonth07ContractRoomAvgPrice();
	        BigDecimal month07ContractCarAvgPrice = obj.getMonth07ContractCarAvgPrice();
	        BigDecimal month07ContractTotalPrice = obj.getMonth07ContractTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month07ContractRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month07ContractStallCount));
	        this.appendCell(row, index.addAndGet(1),month07ContractRoomArea == null ? "" : ReportUtils.toString(month07ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month07ContractRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month07ContractCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month07ContractTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month07ContractRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month07ContractStallPrice));
	        //7月-去化
	        BigDecimal month07CountRemovalRate =obj.getMonth07CountRemovalRate();
	        BigDecimal month07AreaRemovalRate = obj.getMonth07AreaRemovalRate();
	        BigDecimal month07PriceRemovalRate = obj.getMonth07PriceRemovalRate();
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month07CountRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month07AreaRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month07PriceRemovalRate));
        }
        
        if(month >= 8) {
	      //8月-供货
	        BigDecimal month08stockRoomCount = obj.getMonth08stockRoomCount();
	        BigDecimal month08stockStallCount = obj.getMonth08stockStallCount();
	        BigDecimal month08stockRoomArea = obj.getMonth08stockRoomArea();
	        BigDecimal month08stockStallPrice = obj.getMonth08stockStallPrice();
	        BigDecimal month08stockRoomPrice = obj.getMonth08stockRoomPrice();
	        BigDecimal month08stockRoomAvgPrice = obj.getMonth08stockRoomAvgPrice();
	        BigDecimal month08stockCarAvgPrice = obj.getMonth08stockCarAvgPrice();
	        BigDecimal month08stockTotalPrice = obj.getMonth08stockTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month08stockRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month08stockStallCount));
	        this.appendCell(row, index.addAndGet(1), month08stockRoomArea == null ? "" : ReportUtils.toString(month08stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month08stockRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month08stockCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month08stockTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month08stockRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month08stockStallPrice));
	        //8月-签约
	        BigDecimal month08ContractRoomCount = obj.getMonth08ContractRoomNum();
	        BigDecimal month08ContractStallCount = obj.getMonth08ContractStallNum();
	        BigDecimal month08ContractRoomArea = obj.getMonth08ContractRoomArea();
	        BigDecimal month08ContractStallPrice = obj.getMonth08ContractStallPrice();
	        BigDecimal month08ContractRoomPrice = obj.getMonth08ContractRoomPrice();
	        BigDecimal month08ContractRoomAvgPrice = obj.getMonth08ContractRoomAvgPrice();
	        BigDecimal month08ContractCarAvgPrice = obj.getMonth08ContractCarAvgPrice();
	        BigDecimal month08ContractTotalPrice = obj.getMonth08ContractTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month08ContractRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month08ContractStallCount));
	        this.appendCell(row, index.addAndGet(1),month08ContractRoomArea == null ? "" : ReportUtils.toString(month08ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month08ContractRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month08ContractCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month08ContractTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month08ContractRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month08ContractStallPrice));
	        //8月-去化
	        BigDecimal month08CountRemovalRate =obj.getMonth08CountRemovalRate();
	        BigDecimal month08AreaRemovalRate = obj.getMonth08AreaRemovalRate();
	        BigDecimal month08PriceRemovalRate = obj.getMonth08PriceRemovalRate();
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month08CountRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month08AreaRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month08PriceRemovalRate));
        }
        if(month >= 9) {
	      //9月-供货
	        BigDecimal month09stockRoomCount = obj.getMonth09stockRoomCount();
	        BigDecimal month09stockStallCount = obj.getMonth09stockStallCount();
	        BigDecimal month09stockRoomArea = obj.getMonth09stockRoomArea();
	        BigDecimal month09stockStallPrice = obj.getMonth09stockStallPrice();
	        BigDecimal month09stockRoomPrice = obj.getMonth09stockRoomPrice();
	        BigDecimal month09stockRoomAvgPrice = obj.getMonth09stockRoomAvgPrice();
	        BigDecimal month09stockCarAvgPrice = obj.getMonth09stockCarAvgPrice();
	        BigDecimal month09stockTotalPrice = obj.getMonth09stockTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month09stockRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month09stockStallCount));
	        this.appendCell(row, index.addAndGet(1), month09stockRoomArea == null ? "" : ReportUtils.toString(month09stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month09stockRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month09stockCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month09stockTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month09stockRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month09stockStallPrice));
	        //9月-签约
	        BigDecimal month09ContractRoomCount = obj.getMonth09ContractRoomNum();
	        BigDecimal month09ContractStallCount = obj.getMonth09ContractStallNum();
	        BigDecimal month09ContractRoomArea = obj.getMonth09ContractRoomArea();
	        BigDecimal month09ContractStallPrice = obj.getMonth09ContractStallPrice();
	        BigDecimal month09ContractRoomPrice = obj.getMonth09ContractRoomPrice();
	        BigDecimal month09ContractRoomAvgPrice = obj.getMonth09ContractRoomAvgPrice();
	        BigDecimal month09ContractCarAvgPrice = obj.getMonth09ContractCarAvgPrice();
	        BigDecimal month09ContractTotalPrice = obj.getMonth09ContractTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month09ContractRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month09ContractStallCount));
	        this.appendCell(row, index.addAndGet(1),month09ContractRoomArea == null ? "" : ReportUtils.toString(month09ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month09ContractRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month09ContractCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month09ContractTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month09ContractRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month09ContractStallPrice));
	        //9月-去化
	        BigDecimal month09CountRemovalRate =obj.getMonth09CountRemovalRate();
	        BigDecimal month09AreaRemovalRate = obj.getMonth09AreaRemovalRate();
	        BigDecimal month09PriceRemovalRate = obj.getMonth09PriceRemovalRate();
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month09CountRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month09AreaRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month09PriceRemovalRate));
        }
        if(month >= 10) {
	      //10月-供货
	        BigDecimal month10stockRoomCount = obj.getMonth10stockRoomCount();
	        BigDecimal month10stockStallCount = obj.getMonth10stockStallCount();
	        BigDecimal month10stockRoomArea = obj.getMonth10stockRoomArea();
	        BigDecimal month10stockStallPrice = obj.getMonth10stockStallPrice();
	        BigDecimal month10stockRoomPrice = obj.getMonth10stockRoomPrice();
	        BigDecimal month10stockRoomAvgPrice = obj.getMonth10stockRoomAvgPrice();
	        BigDecimal month10stockCarAvgPrice = obj.getMonth10stockCarAvgPrice();
	        BigDecimal month10stockTotalPrice = obj.getMonth10stockTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month10stockRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month10stockStallCount));
	        this.appendCell(row, index.addAndGet(1), month10stockRoomArea == null ? "" : ReportUtils.toString(month10stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month10stockRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month10stockCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month10stockTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month10stockRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month10stockStallPrice));
	        //10月-签约
	        BigDecimal month10ContractRoomCount = obj.getMonth10ContractRoomNum();
	        BigDecimal month10ContractStallCount = obj.getMonth10ContractStallNum();
	        BigDecimal month10ContractRoomArea = obj.getMonth10ContractRoomArea();
	        BigDecimal month10ContractStallPrice = obj.getMonth10ContractStallPrice();
	        BigDecimal month10ContractRoomPrice = obj.getMonth10ContractRoomPrice();
	        BigDecimal month10ContractRoomAvgPrice = obj.getMonth10ContractRoomAvgPrice();
	        BigDecimal month10ContractCarAvgPrice = obj.getMonth10ContractCarAvgPrice();
	        BigDecimal month10ContractTotalPrice = obj.getMonth10ContractTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month10ContractRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month10ContractStallCount));
	        this.appendCell(row, index.addAndGet(1),month10ContractRoomArea == null ? "" : ReportUtils.toString(month10ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month10ContractRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month10ContractCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month10ContractTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month10ContractRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month10ContractStallPrice));
	        //10月-去化
	        BigDecimal month10CountRemovalRate =obj.getMonth10CountRemovalRate();
	        BigDecimal month10AreaRemovalRate = obj.getMonth10AreaRemovalRate();
	        BigDecimal month10PriceRemovalRate = obj.getMonth10PriceRemovalRate();
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month10CountRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month10AreaRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month10PriceRemovalRate));
        }
        if(month >= 11) {
	      //11月-供货
	        BigDecimal month11stockRoomCount = obj.getMonth11stockRoomCount();
	        BigDecimal month11stockStallCount = obj.getMonth11stockStallCount();
	        BigDecimal month11stockRoomArea = obj.getMonth11stockRoomArea();
	        BigDecimal month11stockStallPrice = obj.getMonth11stockStallPrice();
	        BigDecimal month11stockRoomPrice = obj.getMonth11stockRoomPrice();
	        BigDecimal month11stockRoomAvgPrice = obj.getMonth11stockRoomAvgPrice();
	        BigDecimal month11stockCarAvgPrice = obj.getMonth11stockCarAvgPrice();
	        BigDecimal month11stockTotalPrice = obj.getMonth11stockTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month11stockRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month11stockStallCount));
	        this.appendCell(row, index.addAndGet(1), month11stockRoomArea == null ? "" : ReportUtils.toString(month11stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month11stockRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month11stockCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month11stockTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month11stockRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month11stockStallPrice));
	        //11月-签约
	        BigDecimal month11ContractRoomCount = obj.getMonth11ContractRoomNum();
	        BigDecimal month11ContractStallCount = obj.getMonth11ContractStallNum();
	        BigDecimal month11ContractRoomArea = obj.getMonth11ContractRoomArea();
	        BigDecimal month11ContractStallPrice = obj.getMonth11ContractStallPrice();
	        BigDecimal month11ContractRoomPrice = obj.getMonth11ContractRoomPrice();
	        BigDecimal month11ContractRoomAvgPrice = obj.getMonth11ContractRoomAvgPrice();
	        BigDecimal month11ContractCarAvgPrice = obj.getMonth11ContractCarAvgPrice();
	        BigDecimal month11ContractTotalPrice = obj.getMonth11ContractTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month11ContractRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month11ContractStallCount));
	        this.appendCell(row, index.addAndGet(1),month11ContractRoomArea == null ? "" : ReportUtils.toString(month11ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month11ContractRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month11ContractCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month11ContractTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month11ContractRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month11ContractStallPrice));
	        //11月-去化
	        BigDecimal month11CountRemovalRate =obj.getMonth11CountRemovalRate();
	        BigDecimal month11AreaRemovalRate = obj.getMonth11AreaRemovalRate();
	        BigDecimal month11PriceRemovalRate = obj.getMonth11PriceRemovalRate();
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month11CountRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month11AreaRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month11PriceRemovalRate));
        }
        if(month >= 12) {
	        //12月-供货
	        BigDecimal month12stockRoomCount = obj.getMonth12stockRoomCount();
	        BigDecimal month12stockStallCount = obj.getMonth12stockStallCount();
	        BigDecimal month12stockRoomArea = obj.getMonth12stockRoomArea();
	        BigDecimal month12stockStallPrice = obj.getMonth12stockStallPrice();
	        BigDecimal month12stockRoomPrice = obj.getMonth12stockRoomPrice();
	        BigDecimal month12stockRoomAvgPrice = obj.getMonth12stockRoomAvgPrice();
	        BigDecimal month12stockCarAvgPrice = obj.getMonth12stockCarAvgPrice();
	        BigDecimal month12stockTotalPrice = obj.getMonth12stockTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month12stockRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month12stockStallCount));
	        this.appendCell(row, index.addAndGet(1), month12stockRoomArea == null ? "" : ReportUtils.toString(month12stockRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month12stockRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month12stockCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month12stockTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month12stockRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month12stockStallPrice));
	        //12月-签约
	        BigDecimal month12ContractRoomCount = obj.getMonth12ContractRoomNum();
	        BigDecimal month12ContractStallCount = obj.getMonth12ContractStallNum();
	        BigDecimal month12ContractRoomArea = obj.getMonth12ContractRoomArea();
	        BigDecimal month12ContractStallPrice = obj.getMonth12ContractStallPrice();
	        BigDecimal month12ContractRoomPrice = obj.getMonth12ContractRoomPrice();
	        BigDecimal month12ContractRoomAvgPrice = obj.getMonth12ContractRoomAvgPrice();
	        BigDecimal month12ContractCarAvgPrice = obj.getMonth12ContractCarAvgPrice();
	        BigDecimal month12ContractTotalPrice = obj.getMonth12ContractTotalPrice();
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month12ContractRoomCount));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month12ContractStallCount));
	        this.appendCell(row, index.addAndGet(1),month12ContractRoomArea == null ? "" : ReportUtils.toString(month12ContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month12ContractRoomAvgPrice));
	        this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(month12ContractCarAvgPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month12ContractTotalPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month12ContractRoomPrice));
	        this.appendCell(row, index.addAndGet(1),fmtToWanUnit(month12ContractStallPrice));
	        //12月-去化
	        BigDecimal month12CountRemovalRate =obj.getMonth12CountRemovalRate();
	        BigDecimal month12AreaRemovalRate = obj.getMonth12AreaRemovalRate();
	        BigDecimal month12PriceRemovalRate = obj.getMonth12PriceRemovalRate();
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month12CountRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month12AreaRemovalRate));
	        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(month12PriceRemovalRate));
        }
        //年度-实际可售
        BigDecimal totalCurrentRoomCount = obj.getTotalCurrentRoomCount();
   	 	BigDecimal totalCurrentStallCount = obj.getTotalCurrentStallCount();
   	 	BigDecimal totalCurrentRoomArea = obj.getTotalCurrentRoomArea();
   	 	BigDecimal totalCurrentStallPrice = obj.getTotalCurrentStallPrice();
   	 	BigDecimal totalCurrentRoomPrice = obj.getTotalCurrentRoomPrice();
   	 	BigDecimal totalCurrentRoomAvgPrice = obj.getTotalCurrentRoomAvgPrice();
   	 	BigDecimal totalCurrentCarAvgPrice = obj.getTotalCurrentCarAvgPrice();
   	 	BigDecimal totalCurrentTotalPrice = obj.getTotalCurrentTotalPrice();
   	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalCurrentRoomCount));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalCurrentStallCount));
	 	this.appendCell(row, index.addAndGet(1), totalCurrentRoomArea == null ? "" : ReportUtils.toString(totalCurrentRoomArea.setScale(2,RoundingMode.HALF_UP)));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalCurrentRoomAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalCurrentCarAvgPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalCurrentTotalPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalCurrentRoomPrice));
	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalCurrentStallPrice));

        //年度实际可售（不含未推售阶段自持存货）
	 	BigDecimal currentStockRoomCountExp = obj.getCurrentStockRoomCountExp();
	 	BigDecimal currentStockStallCountExp = obj.getCurrentStockStallCountExp();
	 	BigDecimal currentStockRoomAreaExp = obj.getCurrentStockRoomAreaExp();
	 	BigDecimal currentStockStallPriceExp = obj.getCurrentStockStallPriceExp();
	 	BigDecimal currentStockRoomPriceExp = obj.getCurrentStockRoomPriceExp();
	 	BigDecimal currentStockRoomAvgPriceExp = obj.getCurrentStockRoomAvgPriceExp();
	 	BigDecimal currentStockCarAvgPriceExp = obj.getCurrentStockCarAvgPriceExp();
	 	BigDecimal currentStockTotalPriceExp = obj.getCurrentStockTotalPriceExp();
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(currentStockRoomCountExp));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(currentStockStallCountExp));
 	 	this.appendCell(row, index.addAndGet(1), currentStockRoomAreaExp == null ? "" : ReportUtils.toString(currentStockRoomAreaExp.setScale(2,RoundingMode.HALF_UP)));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(currentStockRoomAvgPriceExp));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(currentStockCarAvgPriceExp));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(currentStockTotalPriceExp));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(currentStockRoomPriceExp));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(currentStockStallPriceExp));

 	 	//年度实际签约
	 	BigDecimal currentContractRoomNum = obj.getCurrentContractRoomNum();
	 	BigDecimal currentContractStallNum = obj.getCurrentContractStallNum();
	 	BigDecimal currentContractRoomArea = obj.getCurrentContractRoomArea();
	 	BigDecimal currentContractStallPrice = obj.getCurrentContractStallPrice();
	 	BigDecimal currentContractRoomPrice = obj.getCurrentContractRoomPrice();
	 	BigDecimal currentContractRoomAvgPrice = obj.getCurrentContractRoomAvgPrice();
	 	BigDecimal currentContractCarAvgPrice = obj.getCurrentContractCarAvgPrice();
	 	BigDecimal currentContractTotalPrice = obj.getCurrentContractTotalPrice();
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(currentContractRoomNum));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(currentContractStallNum));
 	 	this.appendCell(row, index.addAndGet(1),  currentContractRoomArea == null ? "" :ReportUtils.toString(currentContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(currentContractRoomAvgPrice));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(currentContractCarAvgPrice));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(currentContractTotalPrice));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(currentContractRoomPrice));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(currentContractStallPrice));

	 	BigDecimal currentCountRemovalRate =obj.getCurrentCountRemovalRate();
        BigDecimal currentAreaRemovalRate = obj.getCurrentAreaRemovalRate();
        BigDecimal currentPriceRemovalRate = obj.getCurrentPriceRemovalRate();
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(currentCountRemovalRate));
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(currentAreaRemovalRate));
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(currentPriceRemovalRate));

        //年度-去化-不含未推售阶段自持存货
	 	BigDecimal currentCountRemovalRateExp =obj.getCurrentCountRemovalRateExp();
        BigDecimal currentAreaRemovalRateExp = obj.getCurrentAreaRemovalRateExp();
        BigDecimal currentPriceRemovalRateExp = obj.getCurrentPriceRemovalRateExp();
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(currentCountRemovalRateExp));
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(currentAreaRemovalRateExp));
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(currentPriceRemovalRateExp));

        //整盘
        //整盘-存货
        BigDecimal totalSupplyCurrentRoomCount = obj.getTotalSupplyCurrentRoomCount();
	 	BigDecimal totalSupplyCurrentStallCount = obj.getTotalSupplyCurrentStallCount();
	 	BigDecimal totalSupplyCurrentArea = obj.getTotalSupplyCurrentArea();
	 	BigDecimal totalSupplyCurrentStallPrice = obj.getTotalSupplyCurrentStallPrice();
	 	BigDecimal totalSupplyCurrentRoomPrice = obj.getTotalSupplyCurrentRoomPrice();
	 	BigDecimal totalSupplyCurrentRoomAvgPrice = obj.getTotalSupplyCurrentRoomAvgPrice();
	 	BigDecimal totalSupplyCurrentCarAvgPrice = obj.getTotalSupplyCurrentCarAvgPrice();
	 	BigDecimal totalSupplyCurrentTotalPrice = obj.getTotalSupplyCurrentTotalPrice();
	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalSupplyCurrentRoomCount));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalSupplyCurrentStallCount));
 	 	this.appendCell(row, index.addAndGet(1),  totalSupplyCurrentArea == null ? "" :ReportUtils.toString(totalSupplyCurrentArea.setScale(2,RoundingMode.HALF_UP)));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalSupplyCurrentRoomAvgPrice));
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalSupplyCurrentCarAvgPrice));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalSupplyCurrentTotalPrice));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalSupplyCurrentRoomPrice));
 	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalSupplyCurrentStallPrice));

        //整盘-签约
 	 	BigDecimal totalContractRoomNum = obj.getTotalContractRoomNum();
 	 	BigDecimal totalContractStallNum = obj.getTotalContractStallNum();
 	 	BigDecimal totalContractRoomArea = obj.getTotalContractRoomArea();
 	 	BigDecimal totalContractStallPrice = obj.getTotalContractStallPrice();
 	 	BigDecimal totalContractRoomPrice = obj.getTotalContractRoomPrice();
 	 	BigDecimal totalContractRoomAvgPrice = obj.getTotalContractRoomAvgPrice();
 	 	BigDecimal totalContractCarAvgPrice = obj.getTotalContractCarAvgPrice();
 	 	BigDecimal totalContractTotalPrice = obj.getTotalContractTotalPrice();
 	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalContractRoomNum));
  	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalContractStallNum));
  	 	this.appendCell(row, index.addAndGet(1), totalContractRoomArea == null ? "" : ReportUtils.toString(totalContractRoomArea.setScale(2,RoundingMode.HALF_UP)));
  	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalContractRoomAvgPrice));
  	 	this.appendCell(row, index.addAndGet(1),ReportUtils.bigDecimalToString(totalContractCarAvgPrice));
  	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalContractTotalPrice));
  	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalContractRoomPrice));
  	 	this.appendCell(row, index.addAndGet(1),fmtToWanUnit(totalContractStallPrice));

        //整盘-去化
	 	BigDecimal totalCountRemovalRate =obj.getTotalCountRemovalRate();
        BigDecimal totalAreaRemovalRate = obj.getTotalAreaRemovalRate();
        BigDecimal totalPriceRemovalRate = obj.getTotalPriceRemovalRate();
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(totalCountRemovalRate));
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(totalAreaRemovalRate));
        this.appendCell(row, index.addAndGet(1), ReportUtils.toString(totalPriceRemovalRate));

        currentDataRowCursor++;

    }

    /**
     * 插入列
     *
     * @param row
     * @param index
     * @param value
     */
    public synchronized void appendCell(Row row, int index, String value) {
    	Cell cell = row.getCell(index);
        if (cell == null) {
            cell = row.createCell(index);
        }
        if(index >= dynamicColumnBeginIndex-1) {
        	String cellValue =  wb.getXSSFWorkbook().getSheetAt(0).getRow(2).getCell(index).getStringCellValue();
        	if(cellValue.contains("套数") && cellValue.contains("(套)")) {
        		cell.setCellStyle(cellStyle1);
        		wb.getXSSFWorkbook().getSheetAt(0).setColumnWidth(index, 10*256);
        	}
        	if( cellValue.contains("车位数")  &&  cellValue.contains("(个)") ) {
        		cell.setCellStyle(cellStyle1);
        		wb.getXSSFWorkbook().getSheetAt(0).setColumnWidth(index, 10*256);
        	}
        	if(cellValue.contains("均价") || cellValue.contains("合计金额")	|| cellValue.contains("房源金额")|| cellValue.contains("车位金额")) {
        		cell.setCellStyle(cellStyle1);
        	}
        	
        	if(cellValue.contains("面积") && cellValue.contains("（平米）")) {
        		cell.setCellStyle(cellStyle2);
        		wb.getXSSFWorkbook().getSheetAt(0).setColumnWidth(index, 14*256);
        	}
        	
        	if(cellValue.contains("%")) {
        		cell.setCellStyle(cellStyle3);
        		wb.getXSSFWorkbook().getSheetAt(0).setColumnWidth(index, 8*256);
        	}
        }else {
        	copyCellStyle(cell,this.currentType);
        }
        ReportUtils.setCellValue(cell,value);
    }
    /**
     * 导出
     *
     * @param outputStream
     * @throws IOException
     */
    public void write(OutputStream outputStream) throws IOException {
    	wb.write(outputStream);
    }
    
    public static String convertPercent(BigDecimal val) {
		if(val == null) {
			return "";
		}
		DecimalFormat df = new DecimalFormat("0.00%");
		return df.format(val);
	}
    
    public static String fmtToWanUnit(BigDecimal value) {
		String res = "";
		if (value == null) {
			return res;
		}
		res = String.valueOf(value.divide(MathUtils.NUM_10000,0, RoundingMode.HALF_UP));
		return res;
	}
    
}
